Repository navigation
Prevent edit if nothing was formatted - #120
Conversation
Handle trivial cases, where input equals output, to prevent dirty flags in active editors.
|
This looks ok. Can you elaborate on the problem it solves? Is it related to #119? |
|
It was discovered while trying to reproduce the problem described in #119 -- not related. When you format an entire file (or section) once and save it, a subsequent format should not change the text. Idempotency like ensured by https://github.com/google/google-java-format/blob/master/core/src/test/java/com/google/googlejavaformat/java/FormatterIntegrationTest.java#L101 The current implementation replaces the old text with new text, even when they are equal, and that marks the active editor as dirty. |
Handle trivial cases, where input equals output, to prevent dirty flags in active editors.
|
Just give me another second, moving the new code into its own method. |
Handle trivial cases, where input equals output, to prevent dirty flags in active editors.
|
Oh, I see this problem, now that the plugi was fixed to work against Gerrit project. After pressing Ctrl-Shift+F without changes, the file is markes durty, and asterisk appear in fron of the file name. |
|
With this CL applied, the plugin works as expected. There is no difference between @cushon |
|
Sure, what's the best way to release this? I don't know how eclipse plugins are distributed. Would being able to download it from the github release page be a useful place to start? |
That would be cool! I volunteer to upload change to Gerrit with instructions, how to deploy it and write announcement on the repo-discuss mailing list. Thank you again for your help! |
|
You're welcome! |
Handle trivial cases, where input equals output, to prevent dirty flags in active editors.